package mrms.api.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "usermessage", schema = "mrms", catalog = "")
@IdClass(UsermessageEntityPK.class)
public class UsermessageEntity {
    private String uid;
    private int mid;
    private Integer beenread;

    @Id
    @Column(name = "uid")
    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @Id
    @Column(name = "mid")
    public int getMid() {
        return mid;
    }

    public void setMid(int mid) {
        this.mid = mid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UsermessageEntity that = (UsermessageEntity) o;
        return mid == that.mid &&
                Objects.equals(uid, that.uid);
    }

    @Override
    public int hashCode() {

        return Objects.hash(uid, mid);
    }

    @Basic
    @Column(name = "beenread")
    public Integer getBeenread() {
        return beenread;
    }

    public void setBeenread(Integer beenread) {
        this.beenread = beenread;
    }
}
